package servlet;

import model.User;
import service.UserService;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class Reset_Servlet extends HttpServlet {

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doGet(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setCharacterEncoding("utf-8");
//        UserService service = new UserService();
//        List<User> userList;
//        if (name==null){
//            userList = service.queryUserList("");
//        }else {
//            userList = service.queryUserList(name);
//        }
//        System.out.println(name+":"+userList);
        System.out.println("reset");
        req.setAttribute("reset",true);
        RequestDispatcher dis=req.getRequestDispatcher("/main/userInfo.jsp");
        dis.forward(req,resp);
    }
}
